#include<iostream>
#include<stdio.h>
#include<string.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<unistd.h>
#include<errno.h>
using namespace std;

void myperror(const char* msg)
{
    fprintf(stderr,"%s:%s\n",msg,strerror(errno));
}
int main()
{
    printf("printf-------1\n");
    fprintf(stdout,"fprintf------------1\n");

    perror("perror----------2");

    const char* s1 ="write_1-------1\n";
    write(1,s1,strlen(s1));

    const char* s2 ="write_2-------2\n";
    write(2,s2,strlen(s2));

    cout<<"cout---------1"<<endl;
    cerr<<"cerr---------2"<<endl;
    return 0;

}
